
import apiBase from '../basic'
const API_HOST = 'http://11.123.255.126:8899';

const userApi = new apiBase(API_HOST, { withToken: true });
userApi.regRespFilter((data: { errno: number; errmsg: string; data: any }) => {
  if (data.errno !== 0) {
    throw new Error(data.errmsg);
  }
  return data.data;
});

/**
 * 用户鉴权
 */
/** 获取token信息 */
export const getTokenBySid = (sid: string, ref: string): Promise<any> => {
  return userApi.post('/auth/token', { sid, ref }, { withToken: false, });
};
